var express = require('express');
var router = express.Router();
const { uploadFiles } = require('../utils/handleFiles.js')
// 啥也不是
router.post('/uploadImages', function (req, res) {
console.log('123');
   let uploadResult = uploadFiles({
        path:"./public/temp",
        key:"file",
        size:8000
    });
    uploadResult(req,res,error=>{
        if(error){
            console.log('图片上传失败',error);
        }else{
            console.log('图片上传成功',req.files);
            res.send({
                code: 1,
                message: '图片上传成功',
                result: 'temp/' + req.files[0].filename
            })
        }
    })

});
// 啥也不是
module.exports = router;
